group = new Object()
$.ajax({
    url : "/user/api/group_list",
    async: false,
    success : function(data) {
        for (i=0; i<data.length; i++) {
            group[data[i].id] = data[i].name
        }
    }
})
function defaultRelaceFunc(d,i) {
    return sub
    .replaceAll("ID",d.uid)
    .replaceAll("REALNAME",d.realname)
    .replaceAll("GROUP",group[d.group])
}
var USER_SUM = 0
function loadAlluserTable() {
    $.get("/user/api/list",function(data) {
        USER_SUM = data.length
        _userloadfunc(data)
    })
    
}
loadAlluserTable()
function _userloadfunc(data) {
    if (typeof replaceFunc != "function") replaceFunc = defaultRelaceFunc
    table.innerHTML = ''

    for (i=0; i<data.length; i++) {
        d = data[i]
        table.innerHTML += replaceFunc(d,i)
    }
    mdui.mutation()
    mdui.updateTables()
}